<?php defined('IN_IA') or exit('Access Denied');?><?php (!empty($this) && $this instanceof WeModuleSite || 1) ? (include $this->template('public/header', TEMPLATE_INCLUDEPATH)) : (include template('public/header', TEMPLATE_INCLUDEPATH));?>

<?php (!empty($this) && $this instanceof WeModuleSite || 1) ? (include $this->template('public/comhead', TEMPLATE_INCLUDEPATH)) : (include template('public/comhead', TEMPLATE_INCLUDEPATH));?>

<link rel="stylesheet" type="text/css" href="../addons/yzzc_sun/template/public/ygcss.css">

<ul class="nav nav-tabs">
    <span class="ygxian"></span>
    <div class="ygdangq">当前位置:</div>
    <li class="active"><a href="javascript:void(0);">车辆信息</a></li>
    <li><a href="<?php  echo $this->createWebUrl('goods');?>"><i class="fa fa-refresh"></i>返回车辆列表</a></li>
</ul>
<div class="main ygmain">
    <form action="" method="post" class="form-horizontal form" enctype="multipart/form-data">
        <div class="panel panel-default ygdefault">

            <div class="panel-heading wyheader">

                车辆信息

            </div>

            <div class="panel-body">
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">选择门店</label>
                    <div class="col-sm-10">
                        <select name="sid">
                            <?php  if($nowshop['id']>0) { ?>
                            <!--<option value="<?php  echo $nowshop['id'];?>"><?php  echo $nowshop['name'];?></option>-->
                            <?php  } ?>
                            <?php  if(is_array($shop)) { foreach($shop as $sval) { ?>
                            <?php  if($info['sid']==$sval['id']) { ?>
                            <option value="<?php  echo $sval['id'];?>" selected="selected"><?php  echo $sval['name'];?></option>
                            <?php  } else { ?>
                            <option value="<?php  echo $sval['id'];?>"><?php  echo $sval['name'];?></option>
                            <?php  } ?>
                            <?php  } } ?>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">车辆名称</label>
                    <div class="col-sm-9">
                        <input type="text" name="name" class="form-control" value="<?php  echo $info['name'];?>" maxlength="20" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">车牌号码</label>
                    <div class="col-sm-9">
                        <input type="text" name="carnum" class="form-control" value="<?php  echo $info['carnum'];?>" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">车身颜色</label>
                    <div class="col-sm-9">
                        <input type="text" name="colour" class="form-control" value="<?php  echo $info['colour'];?>" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">车辆结构</label>
                    <div class="col-sm-10">
                        <input type="radio" value="1" name="structure" <?php  if($info['structure']==1 || empty($info['structure'])) { ?>checked<?php  } ?> >两厢
                        <input type="radio" value="2" name="structure" <?php  if($info['structure']==2) { ?>checked<?php  } ?> >三厢
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">变速箱</label>
                    <div class="col-sm-10">
                        <input type="radio" value="1" name="grarbox" <?php  if($info['grarbox']==1 || empty($info['grarbox'])) { ?>checked<?php  } ?> >手动挡
                        <input type="radio" value="2" name="grarbox" <?php  if($info['grarbox']==2 ) { ?>checked<?php  } ?> >自动挡
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">汽车排量</label>
                    <div class="col-sm-9">
                        <input type="text" name="displacement" class="form-control" value="<?php  echo $info['displacement'];?>" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">承载人数</label>
                    <div class="col-sm-9">
                        <input type="number" name="num" class="form-control" value="<?php  echo $info['num'];?>" />
                    </div>
                </div>
                <!--<div class="form-group">-->
                    <!--<label class="col-xs-12 col-sm-3 col-md-2 control-label">租金类型</label>-->
                    <!--<div class="col-sm-10">-->
                        <!--<input type="radio" value="1" name="moneytype" <?php  if($info['moneytype']==1 || empty($info['moneytype'])) { ?>checked<?php  } ?> >日租-->
                        <!--<input type="radio" value="2" name="moneytype" <?php  if($info['moneytype']==2 ) { ?>checked<?php  } ?> >周租-->
                        <!--<input type="radio" value="3" name="moneytype" <?php  if($info['moneytype']==3) { ?>checked<?php  } ?> >月租-->
                        <!--<input type="radio" value="4" name="moneytype" <?php  if($info['moneytype']==4) { ?>checked<?php  } ?> >年租-->
                    <!--</div>-->
                <!--</div>-->
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">汽车日租金</label>
                    <div class="col-sm-9">
                        <input type="text" name="money" class="form-control" value="<?php  echo $info['money'];?>" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">限时活动价格</label>
                    <div class="col-sm-9">
                        <input type="text" name="act_money" class="form-control" value="<?php  echo $info['act_money'];?>" placeholder="如无活动可不填" />
                    </div>
                </div>
                <div class="form-group">
                    <div style='margin-left: 300px;margin-bottom: 10px;font-weight: bold;font-size: 20px;'>*请按照‘yyyy-MM-dd’的格式填写时间，如2019-10-01</div>

                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">活动时间</label>
                    <div class="col-sm-9">
                        <div class="input-group" style="width: 1000px;">
                            <?php  if($info['subscribe_duration']) { ?>
                            <?php  if(is_array($spec)) { foreach($spec as $index => $item) { ?>
                            <div class="actime" style="display: inline-block;width: 900px;">
                                <input class="form-control" name="subscribe_duration[]"  value="<?php  echo $item['spec'];?>" id="" placeholder="请按照‘yyyy-MM-dd’的格式填写时间，如2019-10-01" style="display: inline-block;width:400px;">
                                <!-- <input type="text" class="form-control" name="subscribe_duration[]" value="<?php  echo $item['spec'];?>" class="astime" placeholder="请按照‘yyyy-MM-dd’的格式填写时间，如2019-10-01" style="display: inline-block;width:400px;"> -->
                                <!-- <?php  echo tpl_form_field_date('subscribe_duration[]');?> -->

                                <span style="width: 50px;display: inline-block">价格</span>
                                <input type="text" name="price[]" placeholder="输入价格"  value="<?php  echo $item['price'];?>" style="width: 100px;display: inline-block;height: 30px;border-radius: 2px;">
                                <div style="width: 100px;display: inline-block;height: 30px;border-radius: 2px;">
                                    <button type="button" class="storespan btn btn-xs addSpec" style="height: 35px;width: 35px;margin-top: -1px;">添加</button>
                                    <button type="button" class="storespan btn btn-xs delSpec" style="height: 35px;width: 35px;margin-top: -1px;">删除</button>
                                </div>
                            </div>
                            <?php  } } ?>
                            <?php  } else { ?>
                            <div class="actime" style="display: inline-block;width: 800px;margin-bottom: 2px;">
                                <input class="form-control" name="subscribe_duration[]"  value="" id="" placeholder="请按照‘yyyy-MM-dd’的格式填写时间，如2019-10-01" style="display: inline-block;width:400px;">
                                <!-- <input type="text" class="form-control" name="subscribe_duration[]" value="<?php  echo $item['spec'];?>" class="astime" placeholder="请按照‘yyyy-MM-dd’的格式填写时间，如2019-10-01" style="display: inline-block;width:400px;"> -->
                                <!-- <?php  echo tpl_form_field_date('subscribe_duration[]');?> -->
                                

                                <div style="width: 50px;display: inline-block;margin-left: 20px;">价格</div>
                                <input type="text" name="price[]"  placeholder="输入价格" style="width: 100px;display: inline-block;height: 30px;border-radius: 2px;">
                                <div style="width: 100px;display: inline-block;height: 30px;border-radius: 2px;">
                                    <button type="button" class="storespan btn btn-xs addSpec" style="height: 35px;width: 35px;margin-top: -1px;">添加</button>
                                    <button type="button" class="storespan btn btn-xs delSpec" style="height: 35px;width: 35px;margin-top: -1px;">删除</button>
                                </div>
                            </div>
                            <?php  } ?>

                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label  class="col-sm-2 control-label">是否使用独立押金</label>
                    <div class="col-sm-10">
                        <label class="radio-inline">
                            <input type="radio" id="depositway1" name="depositway" value="1" <?php  if($info['depositway']=='1' || empty($info['depositway'])) { ?>checked<?php  } ?> />
                            <label for="depositway1">是</label>
                        </label>
                        <label class="radio-inline">
                            <input type="radio" id="depositway2" name="depositway" value="0" <?php  if($info['depositway']=='0') { ?>checked<?php  } ?> />
                            <label for="depositway2">否</label>
                        </label>
                        <span class="help-block">*不使用独立押金，则使用平台设置的总押金。</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">订单押金</label>
                    <div class="col-sm-3">
                        <input type="text" name="deposit" class="form-control" value="<?php  echo $info['deposit'];?>" placeholder="0为不需要押金"/>
                    </div>
                </div>
                <div class="form-group" style="width: 90%;margin-left: 15px;">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">汽车类型</label>
                        <div class="col-sm-10">
                            <select name="cartype">
                                <?php  if(is_array($cartype)) { foreach($cartype as $val) { ?>
                                    <?php  if($info['cartype']==$val['id']) { ?>
                                    <option value="<?php  echo $val['id'];?>" selected="selected"><?php  echo $val['name'];?></option>
                                    <?php  } else { ?>
                                    <option value="<?php  echo $val['id'];?>"><?php  echo $val['name'];?></option>
                                    <?php  } ?>
                                <?php  } } ?>
                            </select>
                        </div>
                </div>

                <div class="form-group" style="width: 90%;margin-left: 15px;">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">租车简介</label>
                    <div class="col-sm-10">
                        <textarea name="content" class="form-control" cols="30" rows="7"><?php  echo $info['content'];?></textarea>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">手续费</label>
                    <div class="col-sm-9">
                        <input type="text" name="fee" class="form-control" value="<?php  echo $info['fee'];?>" />
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">基础服务费</label>
                    <div class="col-sm-9">
                        <input type="text" name="service_fee" class="form-control" value="<?php  echo $info['service_fee'];?>" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">尊享服务费</label>
                    <div class="col-sm-9">
                        <input type="text" name="zx_service_fee" class="form-control" value="<?php  echo $info['zx_service_fee'];?>" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">是否推荐至首页</label>
                    <div class="col-sm-10">
                        <input type="radio" value="1" name="rec" <?php  if($info['rec']==1 || empty($info['rec'])) { ?>checked<?php  } ?> >是
                        <input type="radio" value="2" name="rec" <?php  if($info['rec']==2) { ?>checked<?php  } ?>>否
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">是否热门车</label>
                    <div class="col-sm-10">
                        <input type="radio" value="1" name="hot" <?php  if($info['hot']==1 || empty($info['hot'])) { ?>checked<?php  } ?> >是
                        <input type="radio" value="2" name="hot" <?php  if($info['hot']==2) { ?>checked<?php  } ?>>否
                    </div>
                </div>
                <div class="form-group">
                    <label  class="col-sm-2 control-label">是否开启车辆续租</label>
                    <div class="col-sm-10">
                        <label class="radio-inline">
                            <input type="radio" id="open_xz1" name="open_xz" value="1" <?php  if($info['open_xz']=='1' || empty($info['open_xz'])) { ?>checked<?php  } ?> />
                            <label for="open_xz1">开启</label>
                        </label>
                        <label class="radio-inline">
                            <input type="radio" id="open_xz2" name="open_xz" value="0" <?php  if($info['open_xz']=='0') { ?>checked<?php  } ?> />
                            <label for="open_xz2">关闭</label>
                        </label>
                        <span class="help-block">*全局开启后，此开关才有效。</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">汽车图片</label>
                    <div class="col-sm-9">
                        <?php  echo tpl_form_field_image('pic', $info['pic']);?>
                        <span class="help-block">*建议比例 335*185</span>
                    </div>
                </div>



      </div>
  </div>
        <div class="form-group">

            <input type="submit" name="submit" value="保存设置" class="btn col-lg-3" style="color: white;background-color: #444444;margin-left: 550px;"/>

            <input type="hidden" name="token" value="<?php  echo $_W['token'];?>" />
             <input type="hidden" name="id" value="<?php  echo $info['id'];?>" />

        </div>

    </form>

</div>
<script type="text/javascript">
    $(function(){
        $("#frame-7").show();
        $("#yframe-7").addClass("wyactive");

    })
    layui.use('laydate', function () {
        var laydate = layui.laydate;
        laydate.render({
            elem: '.astime',
            type: 'datetime'
        });

    });
    $(document).ready(function(){
        //点击追加
        $('.input-group').on('click','.addSpec',function () {
            //1.把当前的tr克隆一份
            var newTr = $(this).parents('.actime').clone();
            //2.追加
            $(this).parents('.actime').after(newTr);
        })
        //删除
        $(".input-group").on("click",".delSpec",function(){
            $(this).parents('.actime').remove();
        });

    })
</script>